1. Field of the Invention
The presented invention relates to a compressed data managing system and method, and more particularly to a compressed data managing system and method for circular buffer.
2. Description of the Related Art
A complicated system-on-chip (SoC), as shown in FIG. 1, includes active devices such as a microprocessor 10, a digital signal processor 11, and a direct memory accessor 14, and passive devices such as a hardware accelerator 15, an on-chip memory 12, and an external output interface 13. These devices are connected with an on-chip bus 18 to communicate with each other.
Since the on-chip operations are complicated, it is important to observe the chip's internal operations in order to debug and analyze the chip performance. The most intuitive approach would be to connect interested signals to the chip output pins. However, since a large number of signals need to be observed and chip pins are limited, this approach is generally impractical.
In view of the above, a commonly used method is to place a real-time tracer 16 in a chip to capture signals in real time and store the captured signals in the limited spaced on-chip trace memory 17. After a tracing finishes, a decompression process is performed by the external software in an off-line manner to recover the signals. As the memory space is limited, in a related conventional method a compression function is added to the real-time tracer to increase the volume of traced information in the limited space.
In U.S. Patent Publication No. 2004/0103399 and No. 2007/0094645, program addresses of a microprocessor are compressed. Specifically, a complete address is first recorded, and then only the difference between subsequent data and the complete data need to be recorded. Furthermore, in U.S. Patent Publication No. 2006/0212761 and No. 2003/0126358, a memory is used for compression. Specifically, if the input data is not found in the memory, complete input data needs to be recorded and input to memory; and if the input data is found in memory, only a serial number of the data in the memory needs to be recorded to achieve compression.
The real-time tracer is used to trace the signal before the error occurs. However, when the error occurs, the whole system is unstable. The conventional real-time tracers need several cycles to write the compressed data into the trace memory, which is unbeneficial to error diagnosis. Since when an error occurs, the system might enter the unstable state, this could cause that the tracers fail to write the last compressed data into the trace memory.
Therefore, there is a need for a compressed data managing system and method for circular buffer to solve the above problems.